package com.frinder.official.akka.fault;

import akka.actor.Props;
import com.frinder.official.spring.MyBaseActor;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

/**
 * Created by frinder on 2017/9/13.
 */
@Component
@Scope("prototype")
public class Supervisor extends MyBaseActor {

    @Override
    public Receive createReceive() {
        return receiveBuilder()
                .match(Props.class, props -> {
                    log.debug("Props {}", props);
                    getSender().tell(getContext().actorOf(props), getSelf());
                })
                .build();
    }

}